package com.yanqu.road.entity.activity.tonbing.data;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.FieldTypeAnnotation;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 部分戰場的，紅包同一個阵营的一起玩
 * 阵营数据
 */
@FieldTypeAnnotation(desc = "t_c_tonbing_camp_data")
public class CrossTonBingCampData extends DataObject {

    @FieldTypeAnnotation(desc = "活动ID", select = true, update = true)
    private int activityId;

    @FieldTypeAnnotation(desc = "阵营ID", update = true)
    private int campId;

    @FieldTypeAnnotation(desc = "阵营红包（阵营内唯一编号,红包数据)")
    private Map<Long, CrossTonBingRedPacket> redPacketMap = new ConcurrentHashMap<>();

    @FieldTypeAnnotation(desc = "阵营红包值")
    private long redPacketValue = 0L;

    // ===================== 不入库 =====================

    // 玩家红包数量
    private Map<Long, CrossTonBingUserRedPacketCount> userRedPacketMap = new ConcurrentHashMap<>();

    // ==================================================

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setOp(DataStatus.Update);
        }
    }

    public int getCampId() {
        return campId;
    }

    public void setCampId(int campId) {
        if (this.campId != campId) {
            this.campId = campId;
            setOp(DataStatus.Update);
        }
    }

    public Map<Long, CrossTonBingRedPacket> getRedPacketMap() {
        return redPacketMap;
    }

    public void setRedPacketMap(Map<Long, CrossTonBingRedPacket> redPacketMap) {
        if (null == redPacketMap) {
            return;
        }
        this.redPacketMap = redPacketMap;
        setOp(DataStatus.Update);
    }

    public long getRedPacketValue() {
        return redPacketValue;
    }

    public void setRedPacketValue(long redPacketValue) {
        if (this.redPacketValue != redPacketValue) {
            this.redPacketValue = redPacketValue;
            setOp(DataStatus.Update);
        }
    }

    // ========= 不需要入库 =========

    public Map<Long, CrossTonBingUserRedPacketCount> getUserRedPacketMap() {
        return userRedPacketMap;
    }

    public void setUserRedPacketMap(Map<Long, CrossTonBingUserRedPacketCount> userRedPacketMap) {
        this.userRedPacketMap = userRedPacketMap;
    }
}
